package creational.factory;

public class GenericFactory {

    public static Product create(Class<? extends Product> productClass) throws Exception {
        Class<? extends Product> c = (Class<? extends Product>) Class.forName(productClass.getName());
        return c.newInstance();
    }
}
